#
# choose1 =input('请输入以下选项中您想要进行的操作：注册、登录、注销:')
# if choose1=='登录':
#     name = input('请输入您的账号名：')
#     pwd = input('请输入您的密码：')
#     email = input('请输入您的邮箱：')
#     pass
# f = open('users.csv',mode='r', encoding='UTF-8')
# # s1 = f.read()
# res = f.readlines()
# f.close()
# # print(res1[0])
# for i in res:
#     print(i,end='')
# # if res1[0]==name:
#
#
#
#
#     # if '\n' in i:
#     #     str1 = i[:-1]
#     # else:
#     #     str1 = i
#     # print(i)
# # print("-" * 50)
# from Tools.scripts.make_ctype import values
# from Tools.scripts.make_ctype import values
from operator import truediv

# age = input("请输入您的年龄：")
# print(type(age))


# num = 0
# for i in range(1, 101,2):
#     num = num + i +1
# print(f"1-10之和为:{num}")


# s1 = "shujiakeji"
# # print(len(s1))
# for i in range(len(s1)): # 0 - 9
#      print(s1[i],end=' ')
# else:
#     print()

# s1 = "123期的同学们，大家好"
# print(s1[-7:-4])  # 8,9,10
# print(s1)

# s1 = "123期的同学们，大家好"
# print(s1[::2]) # 3期同们大好欢来数科！
# # print(s1)
#
# s1=input('请输入：')
# if s1.isdigit():
#     print('数字加一为：',int(s1)+1)
#     print(f'数字加一为：{s1}')
# else:
#     print('输入的不是数字')

# s1 = "1001,张三,18,男,33期"
# l1 = s1.split(',')
# print(l1)

# s1 = "1001,张三,18,男,33期"
# l1 = s1.rsplit(',' )
# print(l1) # ['1001', '张三', '18,男,33期']
# print('---------------------')
# l2='|'.join(l1)
# print(l2)



# s1 = '今天我在数加科技学习，今天学习了大数据相关的知识，在数加每一天都很充实！'
# s2 = s1.replace('数加', 'shujia')
# print(f"s1:{s1}")
# print(f"s2:{s2}")


# list1 = [10, 12.23, '数加', True, [11,22,33,44], 'shujia']
# l1=len(list1)
# # print(f"list1列表中的元素个数为：{l1}") # 6
# list1 = [11, 22, 33, 44, 55, 66]
# # -6 -5 -4 -3 -2 -1
# print(list1[2:5])
# print(list1, type(list1))


# list1 = []
# # list1 =list()
# list1.append(100)
# list1.append('hello')
# print(f"list1:{list1}") #
#


# list1 = [11, 22, 33, 44, 55, 66]
# s = list1.pop(3)
# print(f"list1: {list1}")
# print(s)


# list1 = [11, 22, 33, 44, 55, 66]
# print(f"反转前：{list1}")
# list1.reverse()
# print(f"反转后：{list1}")

#
# list1 = [11, 22, 33, 44, 55, 66]
# list2 = list1.copy()
# print(f"list1:{list1}")
# print(f"list2:{list2}")
# print("-----------------------------")
# list1[3] = 100
# print(f"list1:{list1}")
# print(f"list2:{list2}")



# t2 = (11,22,33,)
# print(len(t2))

#
# d1 = {'name': '张三', 'age': 18, 'gender': '男', 'clazz': '33期'}
# keys=list(d1.keys())
# for i in keys:
#     value=d1.get(i)
#     print(f'{i}-{value}')
# key_values = list(d1.items())
# for i in key_values:
#     key=i[0]
#     values=i[1]
#     print(f'{key}={values}')

# s2 = {11, 22, 33, 45, 6, 1, 1, 22, 33, 45, 11}
# # print(s2, type(s2))
# print(s2)
# print(len(s2))
#


# list1= [11, 22, 33, 45, 6, 1, 1, 22, 33, 45, 11]
# print(list1)
# list2 = []
# for i in list1:
#     if i not in list2:
#         list2.append(i)
# print(f"list2:{list2}")


# list1=list(set(list1))
#
# print(list1)

# s1 = {11,22,33,44}
# s2 = {22,33,55,66}
# # res1 = s1 - s2 # 求差集
# # res1 = s1.difference(s2)
# res1 = s1.intersection(s2)
# print(res1)


# s1 = {11,22,44,1,2,3,4,5,6,7,8,9,}
# res1 = s1.pop()
#
# print(s1)
# print(res1)

# 例子：将1-10之间所有的偶数*2 放入到一个列表中
# j=[]
# for i in range(1,11,2):
#     m=(i+1)*2
#     j.append(m)
# print(j)


# list1 = [i * j for i in range(1,11) for j in range(1,11)]
# print(list1)
# # list1 = [i * 2 for i in range(1,11) if i%2==0]
# list1 = [i * 2 for i in range(1,11)]
# print(list1)





# 在控制台中输出99乘法表

# for i in range(1,10):
#     for j in range(1,i+1):
#         m=i*j
#         print(f'{i}*{j}={m}',end='\t')
#     print()
#
# list1 =[ f'{i}*{j}={i*j}' for i in range(1,10) for j in range(1,i+1) ]
# print(list1)


# list1 = [1]
# for i in range(10):
#     print(list1)
#     list1.append(0)
#     list1 = [list1[j] + list1[j - 1] for j in range(i + 2)]
# print(list1)
#

#
# list1=['huang','1234']
#
#
# f=open('users.csv',mode='r',encoding='UTF-8')
# res1 = f.readlines()
# print(res1)
# list1=[]
# list2=[]
# name='huang'
# pwd='1234'
# for list in res1:
#     list=list.strip()
#     list1=list.split(',')
#     list1.append(list[0])
#     list2.append(list[1])
#     print(list1)
#     print(list2)
#     nameint = list1.index(name)
#     print(nameint)
#     if name in list1:
#         nameint=list1.index(name)
#         if list2[1]==pwd:
#             print('登录成功')
#     else:
#         print('账号不存在，请注册：')
#         break

#
# f=open('users.csv',mode='r',encoding='UTF-8')
# res1 = f.readlines()
# list_name=[]
# for list in res1:
#      list=list.strip()
#      list1=list.split(',')
#      list_name.append(list1[0])
#      print(list1[0])
#      print(f'list_name ={list_name}')
#      # namenum = list_name.index('huang')
#      # print(namenum)
# # list1=['huang','1234','12345671qq.com']







# str1 = '今天晚上'
# b1 = str1.encode('UTF-8')
# print(f'b1={b1}')



# import random
# people = ["黄", "李", "王", "张", "杨"]
# winner = random.choice(people)
# print(f"The winner is: {winner}")

# def fun1(hhs, zjj): # hhs zcy是形式参数，名字自定义
#     print(hhs + zjj)
# a1 = int(input("请输入第一个数值："))
# b1 = int(input("请输入第二个数值："))
# fun1(a1,b1)



# def show1(a, b, c):
#     print(f"a:{a},b:{b},c:{c}")
#
# show1(100, c=200, b=300)

#
# def send_email(msg_to, send_info):
#     import smtplib
#     from email.mime.text import MIMEText
#     from email.header import Header
#     msg_from = '986159147@qq.com'  # 发送方邮箱
#     passwd = 'jkahmhkqkpxybfcb'  # 填入发送方邮箱的授权码(填入自己的授权码，相当于邮箱密码)
#     # msg_to = '1114016712@qq.com' #收件方邮箱
#     # msg_to = ['','','']
#     subject = "来自小黄同学的爱心邮件"  # 主题
#     # content = '欢迎来到数加学院' #内容
#     # 生成一个MIMEText对象（还有一些其它参数）
#     msg = MIMEText(send_info)
#     # 放入邮件主题
#     msg['Subject'] = subject
#     # 也可以这样传参
#     # msg['Subject'] = Header(subject, 'utf-8')
#     # 放入发件人
#     msg['From'] = msg_from
#     # 放入收件人
#     # 通过ssl方式发送，服务器地址，端口
#     s = smtplib.SMTP_SSL("smtp.qq.com", 465)
#     # 登录到邮箱
#     s.login(msg_from, passwd)
#     # 发送邮件：发送方，收件方，要发送的消息
#     s.sendmail(msg_from, msg_to, msg.as_string())
#     print('成功')
#
# p = input("请输入要接收邮件的qq邮箱地址：")
# info = input("请输入要发送的内容：")
# send_email(p, info)
#
#

#
# def sum1(a, b):
#     print(a + b)
#
#
#
# # def sum2(a, b, c):
# #     print(a + b + c)
#
# def sum2(a, b, c):
#     print(a + b + c)
# # 需求2：定义一个函数，将来传入三个int类型的值求和
# sum2(10, 20, 30)



# def sum1(*num):
# # 这里的num 是一个元组，接收若干个将来调用时传入的实参
#     n = 0
#     for i in num:
#         n=n + i
#     print(f"总和为：{n}")
#
# sum1(10, 20) # (10, 20)
# sum1(10, 20, 30) # (10, 20, 30)
# sum1(10, 20, 30, 40) # (10, 20, 30, 40)
#


#
# def show1(a, b, *args, **kwargs):
#     print(args, type(args))
#     print(kwargs, type(kwargs))
# # show1(11,22,33,44,name='小虎',address='合肥')
#
# show1(11, 22, 33, 44, name='小虎', address='合肥')
#
# def sum1(*num):
# # 这里的num 是一个元组，接收若干个将来调用时传入的实参
# #     n = 0
# #     for i in num:
# #         n = n + i
# #     print(f"总和为：{n}")
#     print(num, type(num))
#
# sum1(10, 20) # (10, 20)
# sum1(10, 20, 30) # (10, 20, 30)
# sum1(10, 20, 30, 40) # (10, 20, 30, 40)
# sum1(11) # (11,)
# sum1(11, '小虎', [11, 22, 33]) # (11, '小虎', [11, 22, 33])
# sum1((11,22,33)) # ((11, 22, 33),)
#


#
# def sum1(**num):
#     print(num, type(num))
#
# sum1(name='小虎', age=18)
#
#



# def show1(a, b, *args, **kwargs):
#     print(args, type(args))
#     print(kwargs, type(kwargs))
# # show1(11,22,33,44,name='小虎',address='合肥')
# show1(11, 22, 33, 44, name='小虎', address='合肥')
#
# def sum1(a, b):
#     c = a + b
#     return c
#
# res1 = sum1(10, 20)
# print(res1)
# print(res1+20)



# def fun1(a, b):
#     print("今天是星期二")
#     c = a + b
#     return c
#     print("明天自习") # 不执行
#
# res1 = fun1(10, 20)
# print(res1)

# def fun1():
#     for i in range(1,11):
#         return i
#
# res1 = fun1()
# print(res1) # 1

# def show1():
#     return 11, 22, 33
#
# res1 = show1()
# print(res1, type(res1))def get_number():
# # 随机生成一个数
# return num
# n = get_number()
# print(n)


# def login():
# # 登录的操作逻辑
#
# login()

# def get_number():
# # 随机生成一个数
#     return num
#
# n = get_number()
# print(n)

# 定义 两个函数，第一个函数用户循环输入要累加的数值，函数内部将用户输入的值封装成一
# 个列表返回；第二个函数将第一个函数返回的列表当作参数传入，返回列表中所有数据之和的
# 结果。
#
# def show1():
#     i = []
#     while True:
#         n=int(input('请输入您需要累加的值：'))
#         if n== -1:
#             break
#         else:
#             i.append(n)
#     return i
#
# def num(list2):
#     sum1=0
#     for j in list2:
#         sum1=sum1+j
#     return  sum1
#
# list1=show1()
# print(list1)
# sum2=num(list1)
# print(sum2)


#
#
# def get_list():
#     list1 = []
#     while True:
#         n = int(input("请输入一个数值："))
#         if n == -1:
#             break
#         list1.append(n)
#     return list1
#
# def sum_list(l2):
#     n = 0
#     for i in l2:
#         n += i
#     return n
#
# l1 = get_list()
# print(l1)
# res2 = sum_list(l1)
# print(res2)
#
#
#



# def fun1():
#     print("hello world 1")
#
# def fun2():
#     return 100
#
# def fun3(a1, b1):
#     fun1() # 调用fun1函数
#     res1 = fun2() # 调用fun2函数
#     return a1 + b1 + res1
#
# res2 = fun3(11,22)
# print(res2)




#
# def fun1():
#     global b
#     a = 100
#     b =1
#     return a
# fun2 = fun1
# print(fun2())


# def fun1():
#     print("好好学习，天天向上！")
# fun2 = fun1
# fun2()


#
#
# def fun1():
#     print("鹅鹅鹅")
# def fun2():
#     print("曲项向天歌")
# def fun3():
#     print("白毛浮绿水")
# def fun4():
#     print("红掌拨清波")
# fun_list = [fun1, fun2, fun3, fun4]
# flag = input("请输入开始：")
# for i in fun_list:
#     i()

#
# def fun1():
#     print("鹅鹅鹅")
#
#
# def fun2():
#     print("曲项向天歌")
#
#
# def fun3():
#     print("白毛浮绿水")
#
#
# def fun4():
#     print("红掌拨清波")
#
#
# fun_list = [fun1, fun2, fun3, fun4]
#
#
# def show1():
#     for i in fun_list:
#         i()
#
#
# def function1():
#     return show1
#
#
# res1 = function1()
# res1()


# list1 = [11,22,33,44,55]
# res1 = sum(list1)
# print(res1)

# s, y = divmod(16, 5)
# print(s)
# print(y)
# print(pow(2,3))
#




# dict1 = {
#     'name': '黄沪生',
#     'age': 18,
#     'likes': ['踢足球','钓鱼','打游戏'],
#     'pets': [
#         {'name': '小花','age': 2},
#         {'name': '小黑','age': 3}]
#         }
# s3 = json.dumps(dict1, ensure_ascii=False)
# print(s3, type(s3))

import  json
#
# s2 = '''
# {"name":"黄沪生","age":18,"likes":["踢足球","钓鱼","打游戏"]}
# '''
# print(s2, type(s2))
#
# # print(s2['age'])
# res1 = json.loads(s2)
# print(res1, type(res1))
#
# print(res1['likes'])


# import time
# res1 = time.time() # 得到的是一个时间戳格式的数据
# print(res1, type(time)) #


from datetime import  datetime

# s1 = datetime.now() #获取当前时间的date对象
# print(s1,type(s1))  #2024-12-04 10:14:51.211277 <class 'datetime.datetime'>

# '2024年11月29日 10时51分00秒'
# # datetime -> str 日期格式化
# res1 = datetime.strftime(s1,'%Y-%m-%d %H:%M:%S')
# print(res1)
# print("-------------------------------")
# # time.time()
# # 时间戳 -> datetime
# tp = time.time() # 当前的时间戳
# print(tp)
# res2 = datetime.fromtimestamp(tp)
# print(res2, type(res2))
# # datetime -> str
# res3 = datetime.strftime(res2,'%Y/%m/%d%H:%M:%S')
# print(res3, type(res3))
# print("-------------------------------")
# # 字符串 -> datetime
# s2 = '2024/11/29 11:02:28'
# d2 = datetime.strptime(s2,'%Y/%m/%d%H:%M:%S')
# print(d2, type(d2))
# # datetime-> 时间戳
# tp2 = d2.timestamp()
# print(int(tp2))
#

















import os

# s1 = os.path.join('../','text','data','user_info')
# print(s1,type(s1))
# if os.path.exists(s1):
#     f = open(s1,'r',encoding='UTF-8')
#     text1 = f.read()
#     print(text1)
# else:
#     print('路径不存在')


# E:\shujia\Projects\PyCharmProjects\bigdata33\base\text\dengluzhuce.py




import time
from datetime import  datetime

# datetime -> str 日期格式化
# s1 = datetime.now()
# print(s1) # 2024-12-04 15:06:10.369388
# res1 = datetime.strftime(s1,'%Y-%m-%d %H:%M:%S')
# print(res1)  # 2024-12-04 15:06:10
# print("-------------------------------")
# time.time()
# # 时间戳 -> datetime
# tp = time.time() # 当前的时间戳
# print(tp)  #1733295970.3693879
# res2 = datetime.fromtimestamp(tp)
# print(res2, type(res2)) # 2024-12-04 15:06:10.369388 <class 'datetime.datetime'>
# # datetime -> str
# res3 = datetime.strftime(res2,'%Y/%m/%d %H:%M:%S')
# print(res3, type(res3)) #2024/12/04 15:06:10 <class 'str'>
# print("-------------------------------")
# # 字符串 -> datetime
# s2 = '2024/12/04 15:06:10'
# d2 = datetime.strptime(s2,'%Y/%m/%d %H:%M:%S')
# print(d2, type(d2)) # 2024-12-04 15:06:10 <class 'datetime.datetime'>
# # datetime-> 时间戳
# tp2 = d2.timestamp()
# print(int(tp2)) # 1733295970


# tp = 1733295970
# dt1 = datetime.fromtimestamp(tp)
# print(f"{dt1.year}年{dt1.month}月{dt1.day}日 {dt1.hour}时{dt1.minute}分{dt1.second}秒")
# #2024年12月4日 15时6分10秒
#

import os

# ml1 = os.path.abspath(__file__) # __file__代表的是当前的文件
# print(ml1, type(ml1))
# #E:\shujia\Projects\PyCharmProjects\bigdata33\base\learn\123.py <class 'str'>
#
# ml2 = os.path.dirname(ml1)
# print(ml2,type(ml2))
# #E:\shujia\Projects\PyCharmProjects\bigdata33\base\learn <class 'str'>

# import os
#
# ml1 = os.path.abspath(__file__) # __file__代表的是当前的文件
# print(ml1, type(ml1))
# #E:\shujia\Projects\PyCharmProjects\bigdata33\base\learn\123.py <class 'str'>
# ml2 = os.path.dirname(ml1)
# print(ml2,type(ml2))
# #E:\shujia\Projects\PyCharmProjects\bigdata33\base\learn <class 'str'>
# print(os.path.isfile(ml1)) # True
# print(os.path.isfile(ml2)) # False
# print(os.path.isdir(ml1)) # False
# print(os.path.isdir(ml2)) # True



# try:
#     list1 = [1, 2, 3]
#     print(list1[7])
# except:
#     print("出错啦！！！") #出错啦！！！
# print("hello world") #hello world

# try:
#     list1 = [1, 2, 3]
#     print(list1[7])   #出错
#     print("黄沪生真帅！")  #不运行
# except:
#     print("出错啦！！！")  #try出错，则运行   出错啦！！！
# else:
#     print("好好学习，天天向上！")  #只有try中代码不报错，则运行，在此不运行
# finally:
#     print("数加666")  #无论try中的代码是否报错，finally中的代码都会执行  数加666
# print("hello world") #正常运行




#
# # 错误的写法
# class Person:
#     def eat():
#         print("吃饭")
#     def call(name):
#         print(f"打电话给{name}")


# 定义一个类
# class Person:
#     def eat(self):
#         print("吃饭")
#     def call(self,name):
#         print(f"打电话给{name}")
#
# class Person:
#     def eat(self):
#         print("吃饭")
#     def call(self,name):
#         print(f"打电话给{name}")
# # 相当于创建一个Person类的对象，将对象的地址值赋值给变量p1
# p1 = Person()
# p1.eat()   # 吃饭
# p1.call('马云')  # 打电话给马云
# print("----------------------------")
# p2 = Person() # 在内存中开辟一个新的空间
# p2.eat()  #  吃饭
# p2.call('马云')  #打电话给马云
# print(id(p1)==id(p2))  # False 地址值不同


# class Person:
#     def eat(self):
#         print("吃饭")
#     def call(self,name):
#         print(f"打电话给{name}")
# p1 = Person()
# p1.name = '小虎'
# print(f"p1对象的姓名为：{p1.name}")   #  p1对象的姓名为：小虎
# p2 = Person() # 在内存中开辟一个新的空间
# print(f"p1对象的姓名为：{p2.name}") # 报错




#
# class person:
#     def eat(self):
#         print('123')
#     def abc(self):
#         print('456')
#
# p1 = person()
# p1.eat()
# p1.abc()
#

# class Person:
#     def __init__(self,name):
# # self.name 定义一个类中的属性,叫做name
#         self.name = name
#     def eat(self):
#         print("吃饭")
#     def call(self,name):
#         print(f"打电话给{name}")
#
# p1 = Person('小虎')
# print(f"p1对象的姓名为：{p1.name}")  # p1对象的姓名为：小虎
# p2 = Person('张三')
# print(f"p2对象的姓名为：{p2.name}")  # p2对象的姓名为：张三


# # 手机
# '''
# 手机:
# 属性: 品牌, 价格, 颜色
# 行为:打电话, 发短信
# '''
# class shouji:
#     def __init__(self,brand,price,color):
#         self.brand = brand
#         self.price = price
#         self.color = color
#     def call(self,call):
#         print(f'您要打的电话是:{call}')
#     def email(self,email):
#         print(f'您要打的电话是:{email}')


#
# def fun1(a1,b1,c1,d1):
#     pass
# def fun2(a1,b1,c1,d1):
#     pass
# def fun3(a1,b1,c1,d1):
#     pass
#
# fun1(11,22,33,44)
# fun2(11,22,33,44)
# fun3(11,22,33,44)
#
# #改进某一个事物的封装
# class Demo:
# #构造函数
#     def __init__(self,a1,b1,c1,d1):
#         self.a1 = a1
#         self.b1 = b1
#         self.c1 = c1
#         self.d1 = d1
#     def fun1(self):
#         print(f"a1:{self.a1},b1:{self.b1},c1:{self.c1},d1:{self.d1}")
#     def fun2(self):
#         print(f"a1:{self.a1},b1:{self.b1},c1:{self.c1},d1:{self.d1}")
#     def fun3(self):print(f"a1:{self.a1},b1:{self.b1},c1:{self.c1},d1:{self.d1}")
#
# d1 = Demo(11,22,33,44)
# d1.fun1()
# d1.fun2()
# d1.fun3()



# '''
# list1 = [
#     {'name':'张三1','age': 18},
#     {'name':'张三2','age': 19},
#     {'name':'张三3','age': 20},
#     {'name':'张三4','age': 21},
#     ...
# ]
# '''
# user_list = []
# while True:
#     name = input("请输入用户的姓名:")
#     user_dict = {}
#     if name.upper()=='Q':
#         break
#     age = input("请输入用户的年龄:")
#     user_dict['name'] = name
#     user_dict['age'] = age
#     user_list.append(user_dict)
#     print(user_list)
# '''
# list1 = [
#     p1,
#     p2,
#     p3,
#     ...
# ]
# '''
# class Person:
#     def __init__(self,n1,a1):
#         self.name = n1
#         self.age = a1
#     def eat(self):
#         print("吃饭")
#     def sleep(self):
#         print("睡觉")
# user_list = []
# while True:
#     name = input("请输入用户的姓名:")
#     if name.upper()=='Q':
#         break
#     age = input("请输入用户的年龄:")
# # 创建一个学生对象
#     p = Person(name,age)
#     user_list.append(p)
#
# for per in user_list:
#     print(f"姓名:{per.name}, 年龄:{per.age}")



import requests
import json
import re
import pandas as pd
from datetime import datetime



class Student:
    def __init__(self,name,age):
        self.__name = name
        self.__age = age
    def __str__(self):
        return f"姓名:{self.__name}, 年龄:{self.__age}"
    def set_name(self,name):
        self.__name = name
    def get_name(self):
        return self.__name
    def set_age(self,age):
        if 120>=age>0:
            self.__age = age
        else:
            print("您给的年龄不合法,默认已修改为18!")
            self.__age = 18
    def get_age(self):
        return self.__age
    def eat(self):
        print("吃饭")
    def sleep(self):
        print("睡觉")
    def __fun1(self):
        print("hello world")
    def fun2(self):
        self.__fun1()
s1 = Student("黄", 11)
print(s1)  #  姓名:黄, 年龄:11
print("-----------------------------------")
s1.age = 1900 # 这里的age相当于是一个新的属性
s1.__age = 1900 # 使用不了__的属性
s1.set_age(29)
print(s1)  #  姓名:黄, 年龄:29
print(s1.__age)  #  1900
print(s1.get_age())  #  29
#s1.fun1() # 调用不了。报错
s1.fun2() # hello world  间接地调用私有的函数


# 需求：定义一个学生类，根据学生类创建一个学生对象，并修改年龄

#
# class student:
#     def __init__(self,name,age):
#         self.name = name
#         self.age = age
#     def __str__(self):
#         return f'{self.name},{self.age}'
#
# p1 = student('huang',18)
# print(p1)
# p1.age = 11
# print(p1)
#










